package com.wzu.rjgc_ks.serviceImpl;

import com.wzu.rjgc_ks.dao.CompanyMapper;
import com.wzu.rjgc_ks.dao.JobMapper;
import com.wzu.rjgc_ks.dao.JobtypeMapper;
import com.wzu.rjgc_ks.pojo.Company;
import com.wzu.rjgc_ks.pojo.Job;
import com.wzu.rjgc_ks.pojo.Jobtype;
import com.wzu.rjgc_ks.service.CompanyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CompanyServiceImpl implements CompanyService {

    @Autowired
    private CompanyMapper companyMapper;

    @Override
    public Company find_Com_info(Integer id) {
        return companyMapper.selectByPrimaryKey(id);
    }

    @Override
    public int Com_Info_Edit_Save(Company record) {
        companyMapper.updateByPrimaryKey(record);
        return 0;
    }
    @Autowired
    private JobtypeMapper jobtypeMapper;
    @Override
    public List<Jobtype> find_All_JobType() {
        return jobtypeMapper.selectAll();
    }
    @Autowired
    private JobMapper jobMapper;
    @Override
    public int Com_Job_Insert(Job record) {
        jobMapper.insert(record);
        return 0;
    }

    @Override
    public Job Com_Job_Find(Integer jobId) {

        return jobMapper.selectByPrimaryKey(jobId);
    }

    @Override
    public int Com_Job_Edit(Job record) {
        jobMapper.updateByPrimaryKey(record);
        return 0;
    }
}
